package com.example.demo.controller;

import com.example.demo.common.Result;
import com.example.demo.mapper.GoodsMapper;
import com.example.demo.mapper.OrderMapper;
import com.example.demo.mapper.ProcurementMapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: likew
 * @Date: 2022/4/9
 */

//图表数据控制器
@RestController
@RequestMapping("/chart")
public class ChartController extends BaseController{
    
    @Resource
    GoodsMapper goodsMapper;
    
    @Resource
    OrderMapper orderMapper;
    
    @Resource
    ProcurementMapper procurementMapper;
    
    /**
     * 统计数据---货物中地址的数据
     * @return
     */
    @GetMapping("/count-auther")
    public Result<?> countAuther() {
        return Result.success(goodsMapper.countAuthor());
    }
    
    @GetMapping("/count-order")
    public Result<?> getByUserId() {
        return Result.success(procurementMapper.countClassify());
    }
    
}
